#!/bin/bash

# Avoid to use xbacklight, because when you try to call xbacklight too many times in a short time, it would cost a lot of resources.
# This user should be added to the video group.

ICON="$HOME/.config/i3/scripts/res/backlight.png"

nocnoc_plus() {
    dunstify -i $ICON  -t 1500 -r 2601 -u normal "增加亮度，当前亮度值：$(light)"
}

nocnoc_minus() {
    dunstify -i $ICON  -t 1500 -r 2601 -u normal  "减少亮度，当前亮度值： $(light)"
}

case $1 in
    down)
        sudo light -U 5
        nocnoc_minus
        ;;
    up)
        sudo light -A 5
        nocnoc_plus
        ;;
esac

#send_notification
